<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>登录页面</title>
		<link  rel="stylesheet" href="css/bootstrap.min.css"/>
		
	</heade>
	<body>
		<div class="container" 
		style="width: 300px;margin-top: 50px;">
			<fieldset>
				<legend>登录</legend>
				<div class="form-group">
					<label for="username">用户名</label>
					<input class="form-control"
					autocomplete="off"
					type="text" name="username" id="username"/>
				</div>
				<div class="form-group">
					<label for="password">密码</label>
					<input class="form-control"
					type="password" name ="password" id="password"/>
				</div>
				<div class="form-group">
					<button class="btn btn-primary"
					onclick="save()">保存</button>
					<button class="btn btn-danger"
					onclick="jsclear()">取消</button>
				</div>
			</fieldset>
		</div>
	</body>
	<script>
		//点击保存按钮，后哦去用户名和密码打印控制台
/* 		function save(){
			let username=document.getElementById("username");
			let password=document.getElementById("password");
			//不同元素访问属性不同 a.innerText div.innerText
			//input.text.value
			console.log(username.value);
			console.log(password.value);
		}
		//clear被新js标准征用 不能重名 换一个名称
		function clear(){
			
			document.getElementById("username").value='';
			document.getElementById("password").value="";
		} */
		//默认HBuilderX没有jquery提示 最下角 语法提示库
		function save(){
			console.log( $("#username").val() );
						console.log( $("#password").val() );
              /* console.log($("#username").val());
			   console.log($("#password").val()); */
		}
		function clear(){
			$("#username").val('');
			$("#password").val("");
		}
	</script>
</html>
